﻿<html>
<head>
<style>
*{margin:0; padding:0}
.question{border:3px #EEE solid;border-radius:8px; padding:10px;}
.q-item{color:#36A120; font-weight:bold; padding:5px 0; width:100%; background:#FCFCF2;}
.a-item{width:260px; float:left;padding-bottom:5px}
.ans{padding-left:5px;}
.ans input{font-size:16px; width:80%}
</style>
<script type="text/javascript" src="tinymce/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
    mode : "textareas",
    theme : "advanced",
    theme_advanced_buttons1 : "mybutton,bold,italic,underline,separator,strikethrough,forecolor,backcolor,cleanup,code,fullscreen",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_path : false,
    content_css : "tinymce/mycontent.css",

    plugins : 'inlinepopups,fullscreen',
    setup : function(ed) {
        // Add a custom button
        ed.addButton('mybutton', {
            title : 'mybutton',
            image : 'img/example.gif',
            onclick : function() {
                ed.focus();
                ed.selection.setContent('<span style="color:red;text-decoration:underline">' + ed.selection.getContent() + '</span>');
            }
        });
    }
});
</script>
</head>

<body>
<div style="width:600px; text-align:center">
<?php echo '<p style="font-size:20px;color:red">'.($isOk>0?'Lưu dữ liệu thành công':$validate['message']).'</p>';?>
<form action="?act=quiz-edit&id=<?php echo $quiz['id'] ?>" method="post">
	Chọn thể loại: 
	<select name='cate_id'>
		<?php
		foreach ($cates as $key=>$cate) {
			$selected = ($cate['id']==$quiz['cate_id']?'selected="selected"':'');
			echo '<option value="'.$cate['id'].'">'.$cate['name'].'</option>';
		}
		?>
	</select>
	Active: <input type="checkbox" name="active" value="1" <?if($quiz['active']){echo 'checked="checked"';}; ?>" />
	<br /><br />
	<div class="question">
		<p class="q-item"><textarea name="content" style="width:100%"> <?echo $quiz['content'];?></textarea></p>
		<?php
		foreach ($quiz['aryChoice'] as $key=>$choice) {
			$checked = ($key==$quiz['answer']?'checked="checked"':'');
			echo '<p class="a-item"><input type="radio" name="answer" value="'.$key.'" '.$checked.'/><span class="ans"><input type="text" name="choices[]" value="'.$choice.'" /></span></p>';
		}
		?>
		<br style="clear:both" />
	</div>
	
	<input type="submit" name="btnSubmit" value="save" style="margin-top:30px;padding:3px; font-size:18px" />
</form>
</div>
</body>
</html>